import { Component, ViewEncapsulation } from '@angular/core';

@Component({
  selector: 'app-picker-mode',
  templateUrl: './picker-mode.component.html',
  encapsulation: ViewEncapsulation.None
})
export class PickerModeComponent {
  noDate: null;
  pickerPlaceHolder = 'Select year';
  pickerMode = 'year';
  format = 'yyyy';
  simpleModeDate: null;

  changePickerMode(parma) {
    this.pickerMode = parma;

    if (parma === 'year') {
      this.pickerPlaceHolder = 'Select year';
      this.format = 'yyyy';
    } else if (parma === 'month') {
      this.pickerPlaceHolder = 'Select month';
      this.format = 'yyyy-MM';
    } else if (parma === 'date') {
      this.pickerPlaceHolder = 'Select date';
      this.format = 'yyyy-MM-dd';
    } else {
      this.pickerPlaceHolder = '';
      this.format = 'yyyy-MM-dd';
    }
  }
}
